FROM isrc.iscas.ac.cn/learningeulixos/debian:sid-slim as builder

ENV DEBIAN_FRONTEND=noninteractive

RUN cat <<'EOF' > /etc/apt/sources.list.d/debian.sources
Types: deb
URIs: http://mirror.iscas.ac.cn/debian
Suites: sid
Components: main contrib non-free non-free-firmware
Signed-By: /usr/share/keyrings/debian-archive-keyring.gpg
EOF

RUN apt update && \
    apt install -y node-corepack nodejs

RUN corepack enable pnpm

COPY ./ /src/
WORKDIR /src/

RUN pnpm install

RUN pnpm run build

FROM isrc.iscas.ac.cn/learningeulixos/nginx:latest

COPY --from=builder /src/public /usr/share/nginx/html

EXPOSE 80
